(Frem): Fix result sign properly.
authorRichard M. Stallman <rms@gnu.org>
Tue, 1 Jun 1993 03:37:28 +0000 (03:37 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 1 Jun 1993 03:37:28 +0000 (03:37 +0000)
src/data.c

index c556415898440586c9a9bb14ac97ab7aa73e7990..bedece432854fe40c0039c01f863cdc330b8e2f4 100644 (file)
@@ -1762,7 +1762,8 @@ Both must be numbers or markers.")
 #else
       f1 = drem (f1, f2);
 #endif
-      if (f1 < 0)
+      /* If the "remainder" comes out with the wrong sign, fix it.  */
+      if ((f1 < 0) != (f2 < 0))
        f1 += f2;
       return (make_float (f1));
     }